# (c) 2008 by BogDan Vatra < bogdan@licentia.eu >

project(kontAMabil)

include_directories(BEFORE "${CMAKE_SOURCE_DIR}/libs")

set(kontAMabil_SRCS kontAMabil.cpp  kontapp.cpp)
QT4_WRAP_CPP(kontAMabil_SRCS kontapp.h)
QT4_ADD_RESOURCES(kontAMabil_SRCS kontAMabil.qrc)

if(WIN32)
  if(MINGW)
    # resource compilation for mingw
    ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/kontAMabil_rc.o
                       COMMAND windres.exe -I${CMAKE_CURRENT_SOURCE_DIR}
                                           -i${CMAKE_CURRENT_SOURCE_DIR}/kontAMabil.rc
                                           -o ${CMAKE_CURRENT_BINARY_DIR}/kontAMabil_rc.o)
    SET(kontAMabil_SRCS ${kontAMabil_SRCS} ${CMAKE_CURRENT_BINARY_DIR}/kontAMabil_rc.o)
    SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -mwindows")
  else(MINGW)
    SET(kontAMabil_SRCS ${kontAMabil_SRCS} kontAMabil.rc)
  endif(MINGW)
endif(WIN32)

add_executable(kontAMabil ${kontAMabil_SRCS})
add_dependencies(kontAMabil KontAMabil)
link_directories( "${CMAKE_SOURCE_DIR}/libs" )
target_link_libraries(kontAMabil KontAMabil ${QT_LIBRARIES})

install(TARGETS kontAMabil DESTINATION "${BIN_INSTALL_DIR}" RUNTIME)

